package pwd.allen.web.annotation;

import pwd.allen.web.enums.KeyEnum;
import pwd.allen.web.enums.LimitEnum;

import java.lang.annotation.*;

/**
 * 防刷
 * @author pwdan
 * @create 2020-05-28 14:14
 **/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RequestLimit {

    /**
     * redis缓存秒数
     * @return
     */
    int seconds() default 10;

    /**
     * 防刷类型
     * @return
     */
    LimitEnum limitType() default LimitEnum.ASYNC;

    /**
     * redisKey类型
     * @return
     */
    KeyEnum keyType() default KeyEnum.USER;
    String value() default "account";

    boolean flagUseMethodName() default true;

}
